<div id="main">
    <b>Điều hướng:</b>
    <br />
    [ <a href="<?php echo Utility::getSiteUrl(); ?>/managequestions/index">Giáo viên: <?php echo $lectureID; ?></a> ]
    > [ <a href="<?php echo Utility::getSiteUrl(); ?>/managequestions/index/<?php echo $subjectID; ?>">Môn học: <?php echo $subjectID;?></a> ]
    > [ <b><a href="<?php echo Utility::getSiteUrl(); ?>/managequestions/index/<?php echo $subjectID; ?>/<?php echo $sectionID; ?>">Phần học: <?php echo $sectionID; ?></a></b> ]

    <br />
    <br />
    <b><a href="<?php echo Utility::getSiteUrl(); ?>/managequestions/index/<?php echo $subjectID; ?>/<?php echo $sectionID; ?>/-1">Thêm câu hỏi mới >>></a></b>
    <br />
    <br />

    <?php if(isset($message)) echo "<center><font color=green><b>$message</b></font></center><br />"; ?>
    <form name='questions' id='questions' action='<?php echo Utility::getSiteUrl(); ?>/managequestions/index' method='post'>
    
    <table border='1' width='500'>
        <thead>
            <tr>
                <th width="100">Mã câu</th>
                <th width="100">Nội dung</th>
                <th width="100">Trọng số</th>
                <th width="100">Thao tác</th>
            </tr>
        </thead>
        <tbody>
            <?php
            if(count($questions)==0)
            {
                ?>
            <tr>
                <td colspan="4" style="text-align:center;color:red">Chưa có Câu hỏi</td>
            </tr>
            <?php
            }
            else
            foreach($questions as $question)
            {
                ?>
                <tr>
                    <td><center><?php echo $question->id; ?></center></td>
                    <td><center><textarea   rows="2" cols="20"><?php echo $question->content; ?></textarea></center></td>
                    <td><center><?php echo $question->weight; ?></center></td>
                    <td>
                        <center>
                        <a href="<?php echo Utility::getSiteUrl(); ?>/managequestions/index/<?php echo $subjectID; ?>/<?php echo $sectionID; ?>/<?php echo $question->id; ?>" >sửa</a> |
                        <a href="<?php echo Utility::getSiteUrl(); ?>/managequestions/deleteQuestion/<?php echo $lectureID; ?>/<?php echo $subjectID; ?>/<?php echo $sectionID; ?>/<?php echo $question->id; ?>" onClick="return confirmOfDeleting();">xóa</a>
                        </center>
                    </td>
                </tr>
                <?php
            }
            ?>
        </tbody>
    </table>
    </form>
</div>